<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const user = `{
        "name":"jack",
        "age":20,
        "gender":"boy",
        "birth":"2020-1-3"
      }`;
      console.log(
        JSON.parse(user, (k, v) => {
          if (k === 'age') {
            return v + '岁';
          }
          if (k === 'birth') {
            return new Date(v);
          }
          if (k === 'name') {
            return undefined;
          }
          return v;
        })
      );
    </script>
  </body>
</html>
